home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / mach / mach.h < prev    next >
C/C++ Source or Header  |  1994-04-20  |  4KB  |  96 lines

  1. /* Standard header for all Mach programs.
  2. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4.  
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9.  
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. Library General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Library General Public
  16. License along with the GNU C Library; see the file COPYING.LIB.  If
  17. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  18. Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef    _MACH_H
  21.  
  22. #define    _MACH_H    1
  23.  
  24. /* Get the basic types used by Mach.  */
  25. #include <mach/mach_types.h>
  26.  
  27. /* This declares the basic variables and macros everything needs.  */
  28. #include <mach_init.h>
  29.  
  30. /* This declares all the real system call functions.  */
  31. #include <mach/mach_traps.h>
  32.  
  33. /* These are MiG-generated headers for the kernel interfaces commonly used.  */
  34. #include <mach/mach_interface.h> /* From <mach/mach.defs>.  */
  35. #include <mach/mach_port.h>
  36. #include <mach/mach_host.h>
  37.  
  38. /* For the kernel RPCs which have system call shortcut versions,
  39.    the MiG-generated header in fact declares `CALL_rpc' rather than `CALL'.
  40.    This file declares the simple `CALL' functions.  */
  41. #include <mach-shortcuts.h>
  42.  
  43.  
  44. /* Receive RPC request messages on RCV_NAME and pass them to DEMUX, which
  45.    decodes them and produces reply messages.  MAX_SIZE is the maximum size
  46.    (in bytes) of the request and reply buffers.  */
  47. extern mach_msg_return_t
  48. __mach_msg_server (boolean_t (*__demux) (mach_msg_header_t *__request,
  49.                      mach_msg_header_t *__reply),
  50.            mach_msg_size_t __max_size,
  51.            mach_port_t __rcv_name),
  52. mach_msg_server (boolean_t (*__demux) (mach_msg_header_t *__request,
  53.                        mach_msg_header_t *__reply),
  54.          mach_msg_size_t __max_size,
  55.          mach_port_t __rcv_name);
  56.  
  57. /* Just like `mach_msg_server', but the OPTION and TIMEOUT parameters are
  58.    passed on to `mach_msg'.  */
  59. extern mach_msg_return_t
  60. __mach_msg_server_timeout (boolean_t (*__demux) (mach_msg_header_t *__request,
  61.                          mach_msg_header_t *__reply),
  62.                mach_msg_size_t __max_size,
  63.                mach_port_t __rcv_name,
  64.                mach_msg_option_t __option,
  65.                mach_msg_timeout_t __timeout),
  66. mach_msg_server_timeout (boolean_t (*__demux) (mach_msg_header_t *__request,
  67.                            mach_msg_header_t *__reply),
  68.              mach_msg_size_t __max_size,
  69.              mach_port_t __rcv_name,
  70.              mach_msg_option_t __option,
  71.              mach_msg_timeout_t __timeout);
  72.  
  73.  
  74. #define __need_FILE
  75. #include <stdio.h>
  76.  
  77. /* Open a stream on a Mach device.  */
  78. extern FILE *mach_open_devstream (mach_port_t device_port, const char *mode);
  79.  
  80. /* Give THREAD a stack and set it to run at PC when resumed.
  81.    If *STACK_SIZE is nonzero, that size of stack is allocated.
  82.    If *STACK_BASE is nonzero, that stack location is used.
  83.    If STACK_BASE is not null it is filled in with the chosen stack base.
  84.    If STACK_SIZE is not null it is filled in with the chosen stack size.
  85.    Regardless, an extra page of red zone is allocated off the end; this
  86.    is not included in *STACK_SIZE.  */
  87. kern_return_t __mach_setup_thread (task_t task, thread_t thread, void *pc,
  88.                    vm_address_t *stack_base,
  89.                    vm_size_t *stack_size);
  90. kern_return_t mach_setup_thread (task_t task, thread_t thread, void *pc,
  91.                  vm_address_t *stack_base,
  92.                  vm_size_t *stack_size);
  93.  
  94.  
  95. #endif    /* mach.h */
  96.